# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年09月02日
"""
list_a = list()
for a in range(5):
	list_a.append(a)

print(list_a)

list_b = [b for b in range(5)]
print(list_b)

# in 后面跟其它可迭代对象,如字符串
list_c = [7*c for c in 'python']
print(list_c)

# 带if条件语句的列表推导式
list_d = [d for d in range(6) if d % 2 != 0]
print(list_d)

# 多个for 循环
list_e = [(e,f*f) for e in range(3) for f in range(5,15,5)]
print(list_e)

# 嵌套列表推导式,多个并列条件
list_g = [[x for x in range(g-3, g)] for g in range(22) if g % 3 == 0 and g != 0]
print(list_g)
